<template>
  <button @click="addTodo">添加</button>
</template>

<script>
export default {
  name: "TodoButton",
  methods: {
    //点击添加按钮
    addTodo() {
      //发送事件到父组件
      this.$emit("addTodo");
    },
  },
};
</script>